#ifndef LIST_H_
#define LIST_H_

#include<stdio.h>
#include"constant.h"
#include"freq.h"
#include"tree.h"

#define QUEUE 0
#define STACK 1
#define SORTED 2

typedef struct listnode{

    struct listnode * next;
    TreeNode * tnptr;
}ListNode;

ListNode * List_build(CharFreq * frequencies);

ListNode * ListNode_create(TreeNode * tn);

// 模式是QUEUE STACK 或是SORTED
ListNode * List_insert(ListNode * head,ListNode * ln,int mode);

void List_print(ListNode * head);

#endif//!LIST_H_